# Maintainer: Stacy Harper <contact@stacyharper.net>
pkgname=sxmo-sway
pkgver=1.7.0
pkgrel=0
pkgdesc="i3 compatible window manager for Wayland - Sxmo version"
url="https://swaywm.org"
arch="all"
license="MIT"
options="!check" # no test suite
provides="sway"
depends="swaybg"
makedepends="cairo-dev
	gdk-pixbuf-dev
	json-c-dev
	libevdev-dev
	libinput-dev
	libxkbcommon-dev
	linux-pam-dev
	meson
	ninja
	pango-dev
	pcre2-dev
	scdoc
	wayland-dev
	wayland-protocols
	wlroots-dev
	eudev-dev
	"
subpackages="
	$pkgname-dbg
	$pkgname-doc
	$pkgname-wallpapers::noarch
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-fish-completion
	"
source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~stacyharper/sway/archive/$pkgver.tar.gz
	sway.desktop
	"
builddir="$srcdir"/sway-$pkgver

build() {
	abuild-meson . output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	install -D -m644 "$srcdir"/sway.desktop \
		"$pkgdir"/usr/share/wayland-sessions/sway.desktop

	# move fish completion files where they are expected
	mv "$pkgdir"/usr/share/fish/vendor_completions.d "$pkgdir"/usr/share/fish/completions
}

wallpapers() {
	pkgdesc="Wallpapers for Sway"
	license="CC0-1.0"
	install_if="$pkgname=$pkgver-r$pkgrel"

	amove usr/share/backgrounds
}

sha512sums="
c1ad1a0b6e2ad59fde684a3d670636d08f2658d2e91bc8c94d80243080ffd2c0641a53942f929d8385eb26756ebf3248576856bc9a70c26c4a06056cbe122150  sxmo-sway-1.7.0.tar.gz
c9bc08fbd9d059c037ad1e3b7ab5e91bcde27dce248cc558c1f126b01c85b1d0d4ed4bb10e3f27bc818a06e60a81f19478b95529d4eeb32036e2c6ea9f29db36  sway.desktop
"
